#pragma once

#include "Component.h"
#include "Vertex.h"

class CustomMesh
	:public Component
{
public:
	CustomMesh();
	virtual ~CustomMesh();

protected:
	virtual void BuildVertexBuffer() = 0;
	virtual void BuildIndexBuffer() { }

	virtual void OnLostDevice();
	virtual void OnResetDevice();
	virtual void Update(double dt) { }
	virtual void Draw(ID3DXSprite& sprite, D3DXMATRIX& view, D3DXMATRIX& proj) { }

	IDirect3DVertexBuffer9* mVB;
	IDirect3DIndexBuffer9* mIB;

	ID3DXEffect* mFx;
	ID3DXBuffer* mErrors;

	D3DXHANDLE mhTech;
	D3DXHANDLE mhWVP;
};

